﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report5FTradeEasyUI.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.FTradeModel.Report5FTradeEasyUI" %>
<%--5.逾期利息--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../EasyUI/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../EasyUI/themes/icon.css" />
	<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>   
	<script type="text/javascript" src="../EasyUI/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../EasyUI/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="../EasyUI/easyui-formatter_20140718.js"></script>
     <link href="../themes/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <script src="../js/DWZ/jquery.autocomplete.js" type="text/javascript"></script>

    <script type="text/javascript">
        ///自适应宽高
       $(window).resize(function(){		    
             $("#tab_list").datagrid({
                    width: '100%',
                    height: $(parent.document).find(".tabsPageContent").height() - 11 > 0 ? $(parent.document).find(".tabsPageContent").height() - 11 : 500,
             }); 
	    });
        //权限处理
        var $powers={
            "r查看":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.查看) %>
        };

        $(document).ready(function () {
            var $tab_toolbar=$("#tab_toolbar");
            $tab_toolbar.find("a").each(function(){
                var $per=$(this).attr("Permission");
                var pt= $powers[$per]==undefined || null?true:$powers[$per];
                $(this).linkbutton(pt?'enable': 'disable');
            })

            //自动完成
            $(".autocomplete").each(function () {
                var $this = $(this);
                var url = unescape($this.attr("autocompletehref"));
                $this.autocomplete(url);
            });
            //加载数据
            InitGird();           
        })
        //加载列表数据
        function InitGird() {
            $('#tab_list').datagrid({               
                url: location.href, //请求数据的页面
                sortName: 'HeTongHao', //排序字段
                sortOrder: 'desc', //排序类型
                idField: 'HeTongHao', //标识字段,主键
                iconCls: '', //标题左边的图标
                width: '100%', //宽度    
                height: $(parent.document).find(".tabsPageContent").height() - 11 > 0 ? $(parent.document).find(".tabsPageContent").height() - 11 : 500,
                nowrap: true, //是否换行，True 就会把数据显示在一行里
                striped: true, //True 奇偶行使用不同背景色
                collapsible: false, //可折叠
                singleSelect: true, //是否只能选中一条
                remoteSort: true,
                columns: [[
                    { title: '统计月份', field: 'TongJiMonth', width: 70  },
                    { title: '合同号', field: 'HeTongHao', width:100 },
                    {title:'机号',field:'JiHao',width: 100,formatter:function(value, row, index){
                         if(value==undefined)
                                return "合计:";
                        return value;
                    }},                	
                    {title: '未收款项余额', field: 'WeiShouKuanXiang', width: 100,formatter:milliformatter},
                    { title: '到期日', field: 'DaoQiRi', width: 90, formatter:formatterdate},
                    { title: '逾期金额', field: 'yiqijine', width: 80,formatter:milliformatter},
                    { title: '计息天数', field: 'accrualDay', width: 90},
                    { title: '逾期利息', field: 'yiQiRate', width: 90,formatter:milliformatter},                   
                    { title: '销售状态', field: 'ZDXiaoShouState', width: 90},
                    { title: '销售日期', field: 'ZDXiaoShouShiJian', width: 90},
                    { title: '回款条款', field: 'XiaoShouLeiXing', width: 100}
                ]],
                toolbar: "#tab_toolbar",
                queryParams: { "action": "query" },
                pagination: false, //是否开启分页
                rownumbers: true, //行号
                showFooter: true,
                onHeaderContextMenu: function(e, field){
					e.preventDefault();
					if (!$('#tmenu').length){
						createColumnMenu();
					}
					$('#tmenu').menu('show', {
						left:e.pageX,
						top:e.pageY
					});
				},
                onRowContextMenu:function(e,rowIndex,rowData)
                {
                    e.preventDefault();
					if (!$('#tmenu').length){
						createColumnMenu();
					}
					$('#tmenu').menu('show', {
						left:e.pageX,
						top:e.pageY
					});
                }
            });

        }       
       
        /*显示列*/
      
       function createColumnMenu(){
			var tmenu = $('<div id="tmenu" style="width:150px;"></div>').appendTo('body');
			var fields = $('#tab_list').datagrid('getColumnFields');
			for(var i=0; i<fields.length; i++){
				$('<div data-options="name:\''+fields[i]+'\',iconCls:\'icon-ok\'" />').html($('#tab_list').datagrid('getColumnOption',fields[i]).title).appendTo(tmenu);
			}
			tmenu.menu({
				onClick: function(item){
					if (item.iconCls=='icon-ok'){                       
						$('#tab_list').datagrid('hideColumn', item.name);
						tmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-empty'
						});
					} else {
						$('#tab_list').datagrid('showColumn', item.name);
						tmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-ok'
						});
					}
				}
			});
		}
        /*每行的操作处理*/
       
        
    </script>
    <script>
        //操作功能JS

        //打开高级查找窗口
        function onAdjSearch() {
            $("#tab_search").dialog("open");
            $("#search-buttons").find("#btn_search").click(function () {
                var query = $("#tab_search").serializeJSON(); // GetInputData("tab_search", "query");
                query.action = "query";
                $('#tab_list').datagrid("options").queryParams = query;
                $('#tab_list').datagrid('load');
                $("#tab_search").dialog("close");
                return false;
            });
        }

        //导出管控表
        function onExportList() {

            var href = "<%= ExportExcelWebUrl%>/FTradeModel/FTradeExportReport5.aspx?year=<%=Year %>&Month=<%=Month %>&rate=<%=rate %>&uid=<%=User.UserId %>" ;
            top.window.open(href, "");
          //  alert(href);
            return false;
        }
       

    </script>
</head>
<body style="margin:1px;" >
    <div id="tab_list"></div>
    <div id="tab_toolbar" style="padding:2px;">
        <span style="line-height:26px;width:60px; font-weight:bold; color:Red; "><%=base.GetLastUpdate("FTradeCatheringListEasyUI,FTradeReceivablesListEasyUI") %></span>    
       <a href="#"  class="easyui-linkbutton" iconcls="icon-btnDown" plain="true" onclick="return onExportList();" Permission="r导出">导出</a>
    </div>   
    
</body>
</html>